# 拉取镜像 已有就不用
docker pull jeinkins/jenkins:latest

# 新建挂载文件夹
cd /opt/docker_word/
mkdir jeinkins
cd jeinkins
mkdir 8801

# 运行
docker run -d --name jenkins_8801 -p 8801:8080 -v /opt/docker_work/jenkins/8801:/var/jenkins_home -u 0 jenkins:latest

# 页面访问 
# ip:8082 会提示输入密码

# 初始secrets位置
# 进入容器 
docker exec -it jenkins_8801 bash
# 查看密码存在文件
cat  cat /var/jenkins_home/secrets/initialAdminPassword 
# 退出容器
exit

docker stop jenkins_8801
docker rm jenkins_8801
rm -rf /opt/docker_work/jenkins/* 

docker run -d --name jenkins_8801 -p 8801:8080 -v /opt/docker_work/jenkins/8801:/var/jenkins_home -u 0 jenkins:latest
docker exec -it jenkins_8801 bash
cat  cat /var/jenkins_home/secrets/initialAdminPassword 


docker run --name myjenkins -p 8080:8080 -p 50000:50000 -v /var/jenkins_home jenkins